//
//  USSponsorUsHeaderView.m
//  us
//
//  Created by lhx on 2025/5/6.
//

#import "USSponsorUsHeaderView.h"

@implementation USSponsorUsHeaderView


- (void)awakeFromNib {
    [super awakeFromNib];
    
    self.backgroundColor = UIColor.clearColor;

    
    NSString *text = @"支持US团队\n创造更多小美好";
    NSMutableAttributedString *attributedText = [[NSMutableAttributedString alloc] initWithString:text];
    
    NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init];
    paragraphStyle.lineSpacing = 5;
    paragraphStyle.alignment = NSTextAlignmentLeft;

    UIFont *font = [UIFont systemFontOfSize:24 weight:UIFontWeightMedium];
    [attributedText addAttribute:NSParagraphStyleAttributeName value:paragraphStyle range:NSMakeRange(0, attributedText.length)];
    [attributedText addAttribute:NSFontAttributeName value:font range:NSMakeRange(0, attributedText.length)];
    
    NSTextAttachment *spaceAttachment = [[NSTextAttachment alloc] init];
    spaceAttachment.bounds = CGRectMake(0, 0, 4, 1);  // 宽4pt，高随便给1pt
    NSAttributedString *spaceAttrString = [NSAttributedString attributedStringWithAttachment:spaceAttachment];

    [attributedText appendAttributedString:spaceAttrString];
 
    NSTextAttachment *attachment = [[NSTextAttachment alloc] init];
    attachment.image = [UIImage imageNamed:@"ic_love_red"];
    attachment.bounds = CGRectMake(0, -3, 16, 16);
    NSAttributedString *imageAttrString = [NSAttributedString attributedStringWithAttachment:attachment];

    [attributedText appendAttributedString:imageAttrString];

    self.lab0.attributedText = attributedText;
}




@end
